#include "foo1.h"
#include <stdio.h>
#include <dlfcn.h>

/*#include <foo2.h>*/

void callfoo2(float* f, float val)
{
	printf("enter @ func:%s , line:%3d , file:%s .\n",__FUNCTION__, __LINE__, __FILE__);

	void *dp=NULL;
	void (*psetfloatpoint)(float*, float);
	char *error=NULL;

	if(!(dp=dlopen("./libfoo2.so", RTLD_LAZY)))
	{
		printf("load libfoo2.so failed at foo1.\n");
		return ;
	}

	psetfloatpoint=(void (*) (float*, float) )dlsym(dp, "setfloatpoint");
	error=dlerror();
	if(error)
	{
		printf("dlerror exit at foo1.\n");
		return ; /*alex@tips: return void; is not vaild!!*/
	}
	psetfloatpoint(f, val);

	dlclose(dp);

	printf("exit @ func:%s , line:%3d , file:%s .\n",__FUNCTION__, __LINE__, __FILE__);

}

